package com.songlanyun.modules.platformgivepoint.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.songlanyun.modules.platformgivepoint.entity.PlatformGivePointRecordDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.songlanyun.modules.platformgivepoint.entity.PlatformGivePointRecordEntity;
import com.songlanyun.modules.platformgivepoint.service.PlatformGivePointRecordService;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.R;



/**
 * 平台赠与用户积分
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2022-12-27 13:48:32
 */
@RestController
@RequestMapping("admin/platformgivepointrecord")
public class PlatformGivePointRecordController {
    @Autowired
    private PlatformGivePointRecordService platformGivePointRecordService;

    /**
     * 列表
     */
    @RequestMapping("/page")
    //@RequiresPermissions("platformgivepoint:platformgivepointrecord:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = platformGivePointRecordService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("platformgivepoint:platformgivepointrecord:info")
    public R info(@PathVariable("id") Long id){
		PlatformGivePointRecordEntity platformGivePointRecord = platformGivePointRecordService.getById(id);

        return R.ok().put("platformGivePointRecord", platformGivePointRecord);
    }

    /**
     * 保存
     */
    @RequestMapping("/give")
    //@RequiresPermissions("platformgivepoint:platformgivepointrecord:save")
    public R give(@RequestBody PlatformGivePointRecordDto dto){
		platformGivePointRecordService.give(dto);

        return R.ok();
    }



}
